<html>
<!-- =====================================================================

  File:      Generated file for Adventure Works Cycles Storefront Sample
  Summary:   Self-documentation for application
  Date:	     June 16, 2003

=====================================================================

  This file is part of the Microsoft SQL Server Code Samples.
  Copyright (C) 2003 Microsoft Corporation.  All rights reserved.

This source code is intended only as a supplement to Microsoft
Development Tools and/or on-line documentation.  See these other
materials for detailed information regarding Microsoft code samples.

THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

======================================================= -->
<head>
  <link rel=stylesheet href=style.css>
</head>
<body>
<div class=SourcePanel style="font-size:12">
<pre style="background-color:white">
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Collections</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">ComponentModel</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Data</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Drawing</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Data</span>.<span style="color: #2040a0">SqlClient</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">SessionState</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span>.<span style="color: #2040a0">WebControls</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span>.<span style="color: #2040a0">HtmlControls</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Configuration</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Globalization</span><span style="color: #4444FF">;</span>


<span style="color: #008000">/* =====================================================================

  File:      CheckOut.aspx.cs for Adventure Works Cycles Storefront Sample
  Summary:   Allows the user to review the shopping cart, and places an order if the user presses the submit button.
  Date:	     June 16, 2003

---------------------------------------------------------------------

  This file is part of the Microsoft SQL Server Code Samples.
  Copyright (C) Microsoft Corporation.  All rights reserved.

This source code is intended only as a supplement to Microsoft
Development Tools and/or on-line documentation.  See these other
materials for detailed information regarding Microsoft code samples.

THIS CODE AND INFORMATION ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

======================================================= */</span>


<span style="color: #0000FF"><strong>namespace</strong></span> <span style="color: #2040a0">Microsoft</span>.<span style="color: #2040a0">Samples</span>.<span style="color: #2040a0">SqlServer</span>
<span style="color: #4444FF"><strong>{</strong></span>
	<span style="color: #008000">/// &lt;summary&gt;</span>
	<span style="color: #008000">/// Summary description for CheckOut2.</span>
	<span style="color: #008000">/// &lt;/summary&gt;</span>
    <span style="color: #0000FF"><strong>public</strong></span> <span style="color: #2040a0">partial</span> <span style="color: #0000FF"><strong>class</strong></span> <span style="color: #2040a0">CheckOut</span> <span style="color: #4444FF">:</span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span>.<span style="color: #2040a0">Page</span>
	<span style="color: #4444FF"><strong>{</strong></span>
		<span style="color: #2040a0">CustomerAddresses</span> <span style="color: #2040a0">defaultAddresses</span><span style="color: #4444FF">;</span>

		<span style="color: #008000">//*******************************************************</span>
		<span style="color: #008000">//</span>
		<span style="color: #008000">// The Page_Load event on this page is used to load the</span>
		<span style="color: #008000">// ShoppingCart DataGrid *the first time* the page is</span>
		<span style="color: #008000">// accessed.</span>
		<span style="color: #008000">//</span>
		<span style="color: #008000">// Note that subsequent postbacks to the page *do not*</span>
		<span style="color: #008000">// reload the Datagrid.  Instead, we rely on the control's</span>
		<span style="color: #008000">// built-in viewstate management to rebuild the control</span>
		<span style="color: #008000">// on the server.</span>
		<span style="color: #008000">//</span>
		<span style="color: #008000">//*******************************************************</span>
		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">Page_Load</span><span style="color: #4444FF">(</span><span style="color: #2040a0">object</span> <span style="color: #2040a0">sender</span>, <span style="color: #2040a0">System</span>.<span style="color: #2040a0">EventArgs</span> <span style="color: #2040a0">e</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #008000">// Put user code to initialize the page here</span>
			<span style="color: #0000FF"><strong>if</strong></span> <span style="color: #4444FF">(</span><span style="color: #2040a0">Page</span>.<span style="color: #2040a0">IsPostBack</span> <span style="color: #4444FF">=</span><span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>false</strong></span><span style="color: #4444FF">)</span>
			<span style="color: #4444FF"><strong>{</strong></span>
				<span style="color: #008000">// Calculate end-user's shopping cart ID</span>
				<span style="color: #2040a0">ShoppingCartDB</span> <span style="color: #2040a0">cart</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">ShoppingCartDB</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">String</span> <span style="color: #2040a0">cartId</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">cart</span>.<span style="color: #2040a0">GetShoppingCartId</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

				<span style="color: #008000">// Populate datagrid with shopping cart data</span>
				<span style="color: #2040a0">MyDataGrid</span>.<span style="color: #2040a0">DataSource</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">cart</span>.<span style="color: #2040a0">GetItems</span><span style="color: #4444FF">(</span><span style="color: #2040a0">cartId</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">MyDataGrid</span>.<span style="color: #2040a0">DataBind</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

				<span style="color: #008000">// Update total price label</span>
				<span style="color: #2040a0">TotalLabel</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">cart</span>.<span style="color: #2040a0">GetTotal</span><span style="color: #4444FF">(</span><span style="color: #2040a0">cartId</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

				<span style="color: #2040a0">OrdersDB</span> <span style="color: #2040a0">ordersDatabase</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">OrdersDB</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

				<span style="color: #2040a0">ShippingDropDownList</span>.<span style="color: #2040a0">DataSource</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">ordersDatabase</span>.
												  <span style="color: #2040a0">GetShippingMethods</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShippingDropDownList</span>.<span style="color: #2040a0">DataTextField</span> <span style="color: #4444FF">=</span> <span style="color: #444444">&quot;Name&quot;</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShippingDropDownList</span>.<span style="color: #2040a0">DataValueField</span> <span style="color: #4444FF">=</span> <span style="color: #444444">&quot;ShipMethodID&quot;</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShippingDropDownList</span>.<span style="color: #2040a0">DataBind</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

				<span style="color: #2040a0">CustomersDB</span> <span style="color: #2040a0">customerDatabase</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">CustomersDB</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">DataTable</span> <span style="color: #2040a0">allStateProvince</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">customerDatabase</span>.
											 <span style="color: #2040a0">GetAllStateProvince</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

				<span style="color: #2040a0">SetupStateProvinceDropDown</span><span style="color: #4444FF">(</span>
					<span style="color: #2040a0">BillToAddressStateProvinceDropDownList</span>, <span style="color: #2040a0">allStateProvince</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">SetupStateProvinceDropDown</span><span style="color: #4444FF">(</span>
					<span style="color: #2040a0">ShipToAddressStateProvinceDropDownList</span>, <span style="color: #2040a0">allStateProvince</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">AddressControls</span> <span style="color: #2040a0">shipToAddressControls</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">GatherShipToAddressControls</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">AddressControls</span> <span style="color: #2040a0">billToAddressControls</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">GatherBillToAddressControls</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">defaultAddresses</span> <span style="color: #4444FF">=</span>
				<span style="color: #2040a0">customerDatabase</span>.<span style="color: #2040a0">GetCustomerDefaultAddresses</span><span style="color: #4444FF">(</span><span style="color: #2040a0">Int32</span>.
																				<span style="color: #2040a0">Parse</span><span style="color: #4444FF">(</span>
					<span style="color: #2040a0">cartId</span>, <span style="color: #2040a0">CultureInfo</span>.<span style="color: #2040a0">InvariantCulture</span><span style="color: #4444FF">)</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">billToAddressControls</span>.<span style="color: #2040a0">FillControls</span><span style="color: #4444FF">(</span><span style="color: #2040a0">defaultAddresses</span>.
												   <span style="color: #2040a0">BillingAddress</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">shipToAddressControls</span>.<span style="color: #2040a0">FillControls</span><span style="color: #4444FF">(</span><span style="color: #2040a0">defaultAddresses</span>.
												   <span style="color: #2040a0">ShippingAddress</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
			<span style="color: #4444FF"><strong>}</strong></span>
		<span style="color: #4444FF"><strong>}</strong></span>

		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #2040a0">AddressControls</span> <span style="color: #2040a0">GatherShipToAddressControls</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #0000FF"><strong>return</strong></span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">AddressControls</span><span style="color: #4444FF">(</span><span style="color: #2040a0">ShipToAddressLine1TextBox</span>,
								<span style="color: #2040a0">ShipToAddressLine2TextBox</span>,
								<span style="color: #2040a0">ShipToAddressCityTextBox</span>,
								<span style="color: #2040a0">ShipToAddressStateProvinceDropDownList</span>,
								<span style="color: #2040a0">ShipToAddressPostalCodeTextBox</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
		<span style="color: #4444FF"><strong>}</strong></span>

		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #2040a0">AddressControls</span> <span style="color: #2040a0">GatherBillToAddressControls</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #0000FF"><strong>return</strong></span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">AddressControls</span><span style="color: #4444FF">(</span>
					<span style="color: #2040a0">BillToAddressLine1TextBox</span>, <span style="color: #2040a0">BillToAddressLine2TextBox</span>,
					<span style="color: #2040a0">BillToAddressCityTextBox</span>,
					<span style="color: #2040a0">BillToAddressStateProvinceDropDownList</span>,
					<span style="color: #2040a0">BillToAddressPostalCodeTextBox</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
		<span style="color: #4444FF"><strong>}</strong></span>

		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">SetupStateProvinceDropDown</span><span style="color: #4444FF">(</span><span style="color: #2040a0">DropDownList</span>
			<span style="color: #2040a0">stateProvinceDropDownList</span>, <span style="color: #2040a0">DataTable</span> <span style="color: #2040a0">allStateProvince</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #2040a0">stateProvinceDropDownList</span>.<span style="color: #2040a0">DataSource</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">allStateProvince</span><span style="color: #4444FF">;</span>
			<span style="color: #2040a0">stateProvinceDropDownList</span>.<span style="color: #2040a0">DataTextField</span> <span style="color: #4444FF">=</span> <span style="color: #444444">&quot;Name&quot;</span><span style="color: #4444FF">;</span>
			<span style="color: #2040a0">stateProvinceDropDownList</span>.<span style="color: #2040a0">DataValueField</span> <span style="color: #4444FF">=</span> <span style="color: #444444">&quot;StateProvinceID&quot;</span><span style="color: #4444FF">;</span>
			<span style="color: #2040a0">stateProvinceDropDownList</span>.<span style="color: #2040a0">DataBind</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
		<span style="color: #4444FF"><strong>}</strong></span>

		<span style="color: #008000">/// &lt;summary&gt;</span>
		<span style="color: #008000">///		Copy text from the billing address to the shipping address if they are the same</span>
		<span style="color: #008000">///		and the billing address changes.</span>
		<span style="color: #008000">/// &lt;/summary&gt;</span>
		<span style="color: #008000">/// &lt;param name=&quot;sender&quot;&gt;The text box which has changed in the billing address&lt;/param&gt;</span>
		<span style="color: #008000">/// &lt;param name=&quot;e&quot;&gt;Ignored&lt;/param&gt;</span>
        <span style="color: #0000FF"><strong>protected</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">BillingAddressTextBox_TextChanged</span><span style="color: #4444FF">(</span><span style="color: #2040a0">object</span> <span style="color: #2040a0">sender</span>,
													   <span style="color: #2040a0">EventArgs</span> <span style="color: #2040a0">e</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #0000FF"><strong>if</strong></span> <span style="color: #4444FF">(</span><span style="color: #2040a0">ShipSameAsBillCheckBox</span>.<span style="color: #2040a0">Checked</span><span style="color: #4444FF">)</span>
			<span style="color: #4444FF"><strong>{</strong></span>
				<span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">source</span> <span style="color: #4444FF">=</span> <span style="color: #4444FF">(</span><span style="color: #2040a0">TextBox</span><span style="color: #4444FF">)</span><span style="color: #2040a0">sender</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">destination</span><span style="color: #4444FF">;</span>

				<span style="color: #0000FF"><strong>switch</strong></span> <span style="color: #4444FF">(</span><span style="color: #2040a0">source</span>.<span style="color: #2040a0">ID</span><span style="color: #4444FF">)</span>
				<span style="color: #4444FF"><strong>{</strong></span>
					<span style="color: #0000FF"><strong>case</strong></span> <span style="color: #444444">&quot;BillToAddressLine1TextBox&quot;</span><span style="color: #4444FF">:</span> <span style="color: #2040a0">destination</span> <span style="color: #4444FF">=</span>
													  <span style="color: #2040a0">ShipToAddressLine1TextBox</span><span style="color: #4444FF">;</span>
						<span style="color: #0000FF"><strong>break</strong></span><span style="color: #4444FF">;</span>

					<span style="color: #0000FF"><strong>case</strong></span> <span style="color: #444444">&quot;BillToAddressLine2TextBox&quot;</span><span style="color: #4444FF">:</span> <span style="color: #2040a0">destination</span> <span style="color: #4444FF">=</span>
													  <span style="color: #2040a0">ShipToAddressLine2TextBox</span><span style="color: #4444FF">;</span>
						<span style="color: #0000FF"><strong>break</strong></span><span style="color: #4444FF">;</span>

					<span style="color: #0000FF"><strong>case</strong></span> <span style="color: #444444">&quot;BillToAddressCityTextBox&quot;</span><span style="color: #4444FF">:</span> <span style="color: #2040a0">destination</span> <span style="color: #4444FF">=</span>
													 <span style="color: #2040a0">ShipToAddressCityTextBox</span><span style="color: #4444FF">;</span>
						<span style="color: #0000FF"><strong>break</strong></span><span style="color: #4444FF">;</span>

					<span style="color: #0000FF"><strong>case</strong></span> <span style="color: #444444">&quot;BillToAddressPostalCodeTextBox&quot;</span><span style="color: #4444FF">:</span> <span style="color: #2040a0">destination</span> <span style="color: #4444FF">=</span>
														   <span style="color: #2040a0">ShipToAddressPostalCodeTextBox</span><span style="color: #4444FF">;</span>
						<span style="color: #0000FF"><strong>break</strong></span><span style="color: #4444FF">;</span>

					<span style="color: #0000FF"><strong>default</strong></span><span style="color: #4444FF">:</span>
						<span style="color: #2040a0">destination</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">null</span><span style="color: #4444FF">;</span>
						<span style="color: #0000FF"><strong>break</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #4444FF"><strong>}</strong></span>
				<span style="color: #0000FF"><strong>if</strong></span> <span style="color: #4444FF">(</span><span style="color: #2040a0">destination</span> <span style="color: #4444FF">!</span><span style="color: #4444FF">=</span> <span style="color: #2040a0">null</span><span style="color: #4444FF">)</span>
					<span style="color: #2040a0">destination</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">source</span>.<span style="color: #2040a0">Text</span><span style="color: #4444FF">;</span>
			<span style="color: #4444FF"><strong>}</strong></span>
		<span style="color: #4444FF"><strong>}</strong></span>

        <span style="color: #0000FF"><strong>protected</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">BillingAddressDropDownList_SelectedIndexChanged</span><span style="color: #4444FF">(</span><span style="color: #2040a0">object</span>
			<span style="color: #2040a0">sender</span>, <span style="color: #2040a0">EventArgs</span> <span style="color: #2040a0">e</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #0000FF"><strong>if</strong></span> <span style="color: #4444FF">(</span><span style="color: #2040a0">ShipSameAsBillCheckBox</span>.<span style="color: #2040a0">Checked</span><span style="color: #4444FF">)</span>
			<span style="color: #4444FF"><strong>{</strong></span>
				<span style="color: #2040a0">ShipToAddressStateProvinceDropDownList</span>.<span style="color: #2040a0">SelectedIndex</span> <span style="color: #4444FF">=</span>
				<span style="color: #2040a0">BillToAddressStateProvinceDropDownList</span>.
																	   <span style="color: #2040a0">SelectedIndex</span><span style="color: #4444FF">;</span>
			<span style="color: #4444FF"><strong>}</strong></span>
		<span style="color: #4444FF"><strong>}</strong></span>

        <span style="color: #0000FF"><strong>protected</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">ShipSameAsBillCheckBox_CheckedChanged</span><span style="color: #4444FF">(</span><span style="color: #2040a0">object</span> <span style="color: #2040a0">sender</span>,
														   <span style="color: #2040a0">EventArgs</span> <span style="color: #2040a0">e</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #0000FF"><strong>if</strong></span> <span style="color: #4444FF">(</span><span style="color: #2040a0">ShipSameAsBillCheckBox</span>.<span style="color: #2040a0">Checked</span><span style="color: #4444FF">)</span>
			<span style="color: #4444FF"><strong>{</strong></span>
				<span style="color: #2040a0">ShipToAddressLine1TextBox</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>false</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressLine1TextBox</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">BillToAddressLine1TextBox</span>.<span style="color: #2040a0">Text</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressLine2TextBox</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>false</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressLine2TextBox</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">BillToAddressLine2TextBox</span>.<span style="color: #2040a0">Text</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressCityTextBox</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>false</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressCityTextBox</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">BillToAddressCityTextBox</span>.<span style="color: #2040a0">Text</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressStateProvinceDropDownList</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>false</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressStateProvinceDropDownList</span>.<span style="color: #2040a0">SelectedIndex</span> <span style="color: #4444FF">=</span>
				<span style="color: #2040a0">BillToAddressStateProvinceDropDownList</span>.
																	   <span style="color: #2040a0">SelectedIndex</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressPostalCodeTextBox</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>false</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressPostalCodeTextBox</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span>
				<span style="color: #2040a0">BillToAddressPostalCodeTextBox</span>.
													  <span style="color: #2040a0">Text</span><span style="color: #4444FF">;</span>
			<span style="color: #4444FF"><strong>}</strong></span>
			<span style="color: #0000FF"><strong>else</strong></span>
			<span style="color: #4444FF"><strong>{</strong></span>
				<span style="color: #2040a0">ShipToAddressLine1TextBox</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>true</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressLine2TextBox</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>true</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressCityTextBox</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>true</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressStateProvinceDropDownList</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>true</strong></span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">ShipToAddressPostalCodeTextBox</span>.<span style="color: #2040a0">Enabled</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>true</strong></span><span style="color: #4444FF">;</span>
			<span style="color: #4444FF"><strong>}</strong></span>
		<span style="color: #4444FF"><strong>}</strong></span>

		<span style="color: #008000">//*******************************************************</span>
		<span style="color: #008000">//</span>
		<span style="color: #008000">// The SubmitButton_Click event handle is used to order the</span>
		<span style="color: #008000">// items within the current shopping cart.  It then</span>
		<span style="color: #008000">// displays the orderid and order status to the screen</span>
		<span style="color: #008000">// (hiding the &quot;SubmitButton&quot; button to ensure that the</span>
		<span style="color: #008000">// user can't click it twice).</span>
		<span style="color: #008000">//</span>
		<span style="color: #008000">//*******************************************************</span>
		<span style="color: #0000FF"><strong>protected</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">SubmitButton_Click</span><span style="color: #4444FF">(</span><span style="color: #2040a0">object</span> <span style="color: #2040a0">sender</span>,
										<span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span>.<span style="color: #2040a0">ImageClickEventArgs</span> <span style="color: #2040a0">e</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #2040a0">ShoppingCartDB</span> <span style="color: #2040a0">cart</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">ShoppingCartDB</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

			<span style="color: #008000">// Calculate end-user's shopping cart ID</span>
			<span style="color: #2040a0">String</span> <span style="color: #2040a0">cartId</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">cart</span>.<span style="color: #2040a0">GetShoppingCartId</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

			<span style="color: #008000">// Calculate end-user's customerID</span>
			<span style="color: #2040a0">String</span> <span style="color: #2040a0">customerId</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">User</span>.<span style="color: #2040a0">Identity</span>.<span style="color: #2040a0">Name</span><span style="color: #4444FF">;</span>
			<span style="color: #0000FF"><strong>bool</strong></span> <span style="color: #2040a0">isExtendedProcessing</span> <span style="color: #4444FF">=</span>
				 <span style="color: #4444FF">(</span><span style="color: #2040a0">ConfigurationSettings</span>.<span style="color: #2040a0">AppSettings</span><span style="color: #4444FF">[</span><span style="color: #444444">&quot;ExtendedOrderProcessing&quot;</span><span style="color: #4444FF">]</span>.
										 <span style="color: #2040a0">ToUpper</span><span style="color: #4444FF">(</span><span style="color: #2040a0">WorldReady</span>.<span style="color: #2040a0">USCulture</span><span style="color: #4444FF">)</span> <span style="color: #4444FF">=</span><span style="color: #4444FF">=</span>
										 <span style="color: #444444">&quot;TRUE&quot;</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

			<span style="color: #0000FF"><strong>if</strong></span> <span style="color: #4444FF">(</span><span style="color: #4444FF">(</span><span style="color: #2040a0">cartId</span> <span style="color: #4444FF">!</span><span style="color: #4444FF">=</span> <span style="color: #2040a0">null</span><span style="color: #4444FF">)</span> <span style="color: #4444FF">&amp;</span><span style="color: #4444FF">&amp;</span> <span style="color: #4444FF">(</span><span style="color: #2040a0">customerId</span> <span style="color: #4444FF">!</span><span style="color: #4444FF">=</span> <span style="color: #2040a0">null</span><span style="color: #4444FF">)</span><span style="color: #4444FF">)</span>
			<span style="color: #4444FF"><strong>{</strong></span>
				<span style="color: #2040a0">AddressControls</span> <span style="color: #2040a0">shipToAddressControls</span> <span style="color: #4444FF">=</span>
								<span style="color: #2040a0">GatherShipToAddressControls</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">AddressControls</span> <span style="color: #2040a0">billToAddressControls</span> <span style="color: #4444FF">=</span>
								<span style="color: #2040a0">GatherBillToAddressControls</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

				<span style="color: #2040a0">CustomersDB</span> <span style="color: #2040a0">customerDatabase</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">CustomersDB</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #0000FF"><strong>int</strong></span> <span style="color: #2040a0">customerIDNumber</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">Int32</span>.<span style="color: #2040a0">Parse</span><span style="color: #4444FF">(</span><span style="color: #2040a0">customerId</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #0000FF"><strong>int</strong></span> <span style="color: #2040a0">billToAddressID</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">customerDatabase</span>.<span style="color: #2040a0">AccessCustomerAddress</span><span style="color: #4444FF">(</span>
					<span style="color: #2040a0">customerIDNumber</span>, <span style="color: #444444">&quot;Billing&quot;</span>,
					<span style="color: #2040a0">billToAddressControls</span>.<span style="color: #2040a0">GetCustomerAddress</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #0000FF"><strong>int</strong></span> <span style="color: #2040a0">shipToAddressID</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">customerDatabase</span>.<span style="color: #2040a0">AccessCustomerAddress</span><span style="color: #4444FF">(</span>
					<span style="color: #2040a0">customerIDNumber</span>, <span style="color: #444444">&quot;Shipping&quot;</span>,
					<span style="color: #2040a0">shipToAddressControls</span>.<span style="color: #2040a0">GetCustomerAddress</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

				<span style="color: #008000">// Place the order.  If we're using extended processing, start at the initial state, otherwise</span>
				<span style="color: #008000">// just indicate that the order has been shipped.</span>
				<span style="color: #2040a0">OrdersDB</span> <span style="color: #2040a0">ordersDatabase</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">OrdersDB</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #0000FF"><strong>int</strong></span> <span style="color: #2040a0">orderId</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">ordersDatabase</span>.<span style="color: #2040a0">PlaceOrder</span><span style="color: #4444FF">(</span><span style="color: #2040a0">customerId</span>, <span style="color: #2040a0">cartId</span>,
														<span style="color: #2040a0">Int32</span>.<span style="color: #2040a0">Parse</span><span style="color: #4444FF">(</span>
					<span style="color: #2040a0">ShippingDropDownList</span>.<span style="color: #2040a0">SelectedValue</span>,
					<span style="color: #2040a0">CultureInfo</span>.<span style="color: #2040a0">InvariantCulture</span><span style="color: #4444FF">)</span>,
														<span style="color: #2040a0">isExtendedProcessing</span> ?
														<span style="color: #2040a0">Constants</span>.<span style="color: #2040a0">Status</span>.
														<span style="color: #2040a0">PendingInventoryCheck</span> <span style="color: #4444FF">:</span>
														<span style="color: #2040a0">Constants</span>.<span style="color: #2040a0">Status</span>.
														<span style="color: #2040a0">Shipped</span>,
														<span style="color: #2040a0">billToAddressID</span>,
														<span style="color: #2040a0">shipToAddressID</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

				<span style="color: #008000">// Demonstrate service broker features if ExtendedOrderProcessing is true in web.config file.</span>
				<span style="color: #0000FF"><strong>if</strong></span> <span style="color: #4444FF">(</span><span style="color: #2040a0">isExtendedProcessing</span><span style="color: #4444FF">)</span>
				<span style="color: #4444FF"><strong>{</strong></span>
					<span style="color: #2040a0">ExtendedOrderProcessing</span> <span style="color: #2040a0">eop</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">ExtendedOrderProcessing</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

					<span style="color: #2040a0">eop</span>.<span style="color: #2040a0">PostSalesOrder</span><span style="color: #4444FF">(</span><span style="color: #2040a0">orderId</span>, <span style="color: #2040a0">customerId</span>, <span style="color: #2040a0">ordersDatabase</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #4444FF"><strong>}</strong></span>

				<span style="color: #008000">//TODO: probably should receive error messages, if there are any</span>
				<span style="color: #008000">//Update labels to reflect the fact that the order has taken place</span>
				<span style="color: #2040a0">Header</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #444444">&quot;Check Out Complete!&quot;</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">Message</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #444444">&quot;&lt;b&gt;Your Order Number Is: &lt;/b&gt;&quot;</span> <span style="color: #4444FF">+</span> <span style="color: #2040a0">orderId</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">SubmitButton</span>.<span style="color: #2040a0">Visible</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>false</strong></span><span style="color: #4444FF">;</span>
			<span style="color: #4444FF"><strong>}</strong></span>
		<span style="color: #4444FF"><strong>}</strong></span>

<span style="color: #0000ff"><strong>		#region Web Form Designer generated code</strong></span>
		<span style="color: #2040a0">override</span> <span style="color: #0000FF"><strong>protected</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">OnInit</span><span style="color: #4444FF">(</span><span style="color: #2040a0">EventArgs</span> <span style="color: #2040a0">e</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #008000">//</span>
			<span style="color: #008000">// CODEGEN: This call is required by the ASP.NET Web Form Designer.</span>
			<span style="color: #008000">//</span>
			<span style="color: #2040a0">InitializeComponent</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
			<span style="color: #2040a0">base</span>.<span style="color: #2040a0">OnInit</span><span style="color: #4444FF">(</span><span style="color: #2040a0">e</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
		<span style="color: #4444FF"><strong>}</strong></span>

		<span style="color: #008000">/// &lt;summary&gt;</span>
		<span style="color: #008000">/// Required method for Designer support - do not modify</span>
		<span style="color: #008000">/// the contents of this method with the code editor.</span>
		<span style="color: #008000">/// &lt;/summary&gt;</span>
		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">InitializeComponent</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #0000FF"><strong>this</strong></span>.<span style="color: #2040a0">SubmitButton</span>.<span style="color: #2040a0">Click</span> <span style="color: #4444FF">+</span><span style="color: #4444FF">=</span>
			<span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span>.<span style="color: #2040a0">ImageClickEventHandler</span><span style="color: #4444FF">(</span>
				<span style="color: #0000FF"><strong>this</strong></span>.<span style="color: #2040a0">SubmitButton_Click</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
		<span style="color: #4444FF"><strong>}</strong></span>

        <span style="color: #0000FF"><strong>protected</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">ShippingDropDownList_SelectedIndexChanged</span><span style="color: #4444FF">(</span><span style="color: #2040a0">object</span> <span style="color: #2040a0">sender</span>,
													   <span style="color: #2040a0">System</span>.<span style="color: #2040a0">EventArgs</span> <span style="color: #2040a0">e</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
		<span style="color: #4444FF"><strong>}</strong></span>

<span style="color: #0000ff"><strong>		#endregion</strong></span>
	<span style="color: #4444FF"><strong>}</strong></span>

	<span style="color: #0000FF"><strong>public</strong></span> <span style="color: #0000FF"><strong>class</strong></span> <span style="color: #2040a0">AddressControls</span>
	<span style="color: #4444FF"><strong>{</strong></span>
		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">line1</span><span style="color: #4444FF">;</span>

		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">line2</span><span style="color: #4444FF">;</span>

		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">city</span><span style="color: #4444FF">;</span>

		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #2040a0">DropDownList</span> <span style="color: #2040a0">stateProvince</span><span style="color: #4444FF">;</span>

		<span style="color: #0000FF"><strong>private</strong></span> <span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">postalCode</span><span style="color: #4444FF">;</span>

		<span style="color: #0000FF"><strong>public</strong></span> <span style="color: #2040a0">AddressControls</span><span style="color: #4444FF">(</span><span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">line1</span>, <span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">line2</span>, <span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">city</span>,
							   <span style="color: #2040a0">DropDownList</span> <span style="color: #2040a0">stateProvince</span>, <span style="color: #2040a0">TextBox</span> <span style="color: #2040a0">postalCode</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #0000FF"><strong>this</strong></span>.<span style="color: #2040a0">line1</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">line1</span><span style="color: #4444FF">;</span>
			<span style="color: #0000FF"><strong>this</strong></span>.<span style="color: #2040a0">line2</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">line2</span><span style="color: #4444FF">;</span>
			<span style="color: #0000FF"><strong>this</strong></span>.<span style="color: #2040a0">city</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">city</span><span style="color: #4444FF">;</span>
			<span style="color: #0000FF"><strong>this</strong></span>.<span style="color: #2040a0">stateProvince</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">stateProvince</span><span style="color: #4444FF">;</span>
			<span style="color: #0000FF"><strong>this</strong></span>.<span style="color: #2040a0">postalCode</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">postalCode</span><span style="color: #4444FF">;</span>
		<span style="color: #4444FF"><strong>}</strong></span>

		<span style="color: #0000FF"><strong>public</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">FillControls</span><span style="color: #4444FF">(</span><span style="color: #2040a0">CustomerAddress</span> <span style="color: #2040a0">ca</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #0000FF"><strong>if</strong></span> <span style="color: #4444FF">(</span><span style="color: #2040a0">ca</span>.<span style="color: #2040a0">AddressID</span> <span style="color: #4444FF">&gt;</span> <span style="color: #4444FF">-</span><span style="color: #FF0000">1</span><span style="color: #4444FF">)</span>
			<span style="color: #4444FF"><strong>{</strong></span>
				<span style="color: #2040a0">line1</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">ca</span>.<span style="color: #2040a0">Line1</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">line2</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">ca</span>.<span style="color: #2040a0">Line2</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">city</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">ca</span>.<span style="color: #2040a0">City</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">stateProvince</span>.<span style="color: #2040a0">SelectedValue</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">ca</span>.<span style="color: #2040a0">StateProvinceID</span>.<span style="color: #2040a0">ToString</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
				<span style="color: #2040a0">postalCode</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">ca</span>.<span style="color: #2040a0">PostalCode</span><span style="color: #4444FF">;</span>
			<span style="color: #4444FF"><strong>}</strong></span>
		<span style="color: #4444FF"><strong>}</strong></span>

		<span style="color: #0000FF"><strong>public</strong></span> <span style="color: #2040a0">CustomerAddress</span> <span style="color: #2040a0">GetCustomerAddress</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span>
		<span style="color: #4444FF"><strong>{</strong></span>
			<span style="color: #0000FF"><strong>return</strong></span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">CustomerAddress</span><span style="color: #4444FF">(</span><span style="color: #FF0000">0</span>, <span style="color: #2040a0">line1</span>.<span style="color: #2040a0">Text</span>, <span style="color: #2040a0">line2</span>.<span style="color: #2040a0">Text</span>, <span style="color: #2040a0">city</span>.<span style="color: #2040a0">Text</span>,
									   <span style="color: #2040a0">Int32</span>.<span style="color: #2040a0">Parse</span><span style="color: #4444FF">(</span><span style="color: #2040a0">stateProvince</span>.<span style="color: #2040a0">SelectedValue</span>,
												   <span style="color: #2040a0">CultureInfo</span>.<span style="color: #2040a0">InvariantCulture</span><span style="color: #4444FF">)</span>,
									   <span style="color: #2040a0">stateProvince</span>.<span style="color: #2040a0">SelectedItem</span>.<span style="color: #2040a0">Text</span>,
									   <span style="color: #2040a0">postalCode</span>.<span style="color: #2040a0">Text</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

		<span style="color: #4444FF"><strong>}</strong></span>
	<span style="color: #4444FF"><strong>}</strong></span>
<span style="color: #4444FF"><strong>}</strong></span>









  

</pre>
